 
create sequence chw
 start with 1
 increment by 1
 nocache;
 
 select * from user_sequences;
 
 create table mailorder(
 syn number(20),
 staffnum number(20),---주키
 staff_first varchar2(20),
 staff_name varchar2(20),
 mailcode number(20),---외래키
 constraint syn_pk primary key(staffnum),
 constraint mailcode_fk foreign key(mailcode) 
 references customer(mailcode)
 );

 insert into mailorder
 values (chw.nextval,111,'chae','heewon',1234)

 insert into mailorder
 values (chw.nextval,112,'cha','jaewon',1235)
 
 insert into mailorder
 values (chw.nextval,113,'ched','ghwon',1236)
 
 insert into mailorder
 values (chw.nextval,114,'chgew','hddwon',1237)
 
 select *from mailorder
 
 
 
 create table customer(
 synnum2 number(20), 
 cus_num number(20),
 cus_first   varchar2(20),
 cus_name varchar2 (20),
 mailcode number(20),---주키
 constraint mailcode_pk primary key (mailcode)
 );
 
 insert into customer
 values (chw.nextval,12,'vee','ckdj',1234)
 insert into customer
 values (chw.nextval,55,'her','dfiejfi',1234)
 
 insert into customer
 values (chw.nextval,45,'ker','lfiejfi',1284)
 
 
 create table part(
 sysn number(20),
 part_num varchar2(20),--부품순서 기본키
 part_name varchar2(20),--부품명
 price varchar2(20),--------가격
 inventory varchar2(20),---재고수량
 constraint part_num primary key (part_num)
 );
 
 create table order2(
 syne number(20),
 order_num number(20),---기본키
 staffnum number(20),----외래키
 ordervo varchar2(20),---주문량
 accountday varchar2(20),---결재일
 delieveryday varchar2(20), ---배송일
 realdelievery varchar2(20),--실제 배송일
 constraint order_num primary key(order_num),
 constraint staffnum_fk foreign key(staffnum) 
 references mailorder(staffnum)
 );
 
 
create sequence chwgigs 
 start with 1
 increment by 1
 nocache;
 
 select * from user_sequences;
 
 create table movie(
 번호 number(20),
 제목 varchar2(20),
 개봉 varchar2(20),
 상영시간 number(20),
 제작사 varchar2(20),
 장르 varchar2(20),
 감독 varchar2(20),
 배우 varchar2(20),
  줄거리 varchar2(20),
  영화소개 varchar2(100) 
 constraint 번호_pk primary key (번호),
 
 );
 
 create table actor(
 번호2 number(40),
  이름  varchar2(30),
  생년월일 varchar2(30),
  배역 varchar2(30),
  constraint 번호2_pk primary key (번호2)
 
  );
 
 create table director (
 번호3 number(40),
  감독이름 varchar2(40),
  감독생일 varchar2(40),
  감독 varchar2(40),
  감독출연작 varchar2(40)
  constraint 번호3_pk primary key (번호3)
 );
 
 create table company(
  번호4 number(40),
   제작이름 varchar2(40),
   주소 varchar2(40),
   제작영화 varchar2(40)
   constraint 번호4_pk primary key (번호4)
   );